﻿using UnityEngine;
using System.Collections;

public class MeleeWeapon : MonoBehaviour, IWeapon {

	public float Damage = 10;

	protected SpriteRenderer spriteRenderer;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	public virtual void InitWeapon()
	{
		spriteRenderer = this.GetComponent<SpriteRenderer>();
		spriteRenderer.enabled = false;
		if (this.collider2D)
		{
			this.collider2D.enabled = false;
		}
	}
	
	public virtual void UpdateWeapon()
	{
	}

	public void DoWeaponAttack(Vector2 direction)
	{
		OnAttack(direction);
	}
	
	public void Reload()
	{
		OnReload();
	}

	public SpriteRenderer getWeaponSprite()
	{
		return spriteRenderer;
	}

	public virtual void OnAttack(Vector2 direction)
	{
		
	}
	
	public virtual void OnReload()
	{
		
	}


}
